﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace ShevaEngine.Core.Modules
{
    /// <summary>
    /// Font manager.
    /// </summary>
    public class FontManager
    {
        /// <summary>Singleton.</summary>
        public static readonly FontManager Instance = new FontManager();

        /// <summary>Fonts.</summary>
        public Dictionary<string, SpriteFont> Fonts;

        /// <summary>
        /// Get font from name.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public SpriteFont this[string name]
        {
            get
            {
                if (!this.Fonts.ContainsKey(name))
                    this.Fonts.Add(name, ShevaEngine.Instance.Content.Load<SpriteFont>(@"Fonts\" + name));

                return this.Fonts[name];
            }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public FontManager()
        {
            this.Fonts = new Dictionary<string, SpriteFont>();
        }
    }
}
